<%@page import="web.lbsproject.processaudit.model.CheckTaskDefine4Web"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- Begin: WEB-INF/template/taskManage/addTask/checkTaskDefine.jsp -->
<p  class="form-item" align="center"><strong>新增巡检任务类型</strong></p>
<form class = "form" action="AddCheckTaskDefine" method="post">
	<p  class="form-item">
		<label class="item-t" for="description">任务名称：</label>
		<input name="description" type="text" value="" id="description" class="input"/>
		<span class = "text_add">不可重名</span>
	</p>
	<p  class="form-item">
	<label class="item-t" for="level">任务级别：</label>
	<select name="level" id="level">
		<option value="1">普通</option>
		<option value="2">紧急</option>
		<option value="3">非常紧急</option>
	</select>
	</p>
		<p  class="form-item">

	<label class="item-t" for="checkItemList">检查项：</label>
	<input size="60" type="text" name="checkItemList" id="checkItemList"/> 	
	<span class = "text_add">用空格分隔多个检查项</span>
	</p>
	
	<p  class="form-item">
		<input class="btn search-btn" type="submit" value="  添加任务类型  " id = "search"/>
	</p>
</form>
<br/>
	<!-- <p align="center">&nbsp;已添加的巡检任务类型&nbsp; </p>-->
<!-- show existed tasks -->
<div>
	<table class="table">
		<thead>
			<tr>
				<th width="20%">任务描述</th>
				<th width="30">检查项</th>
				<th width="15%">任务级别</th>
				<th width="15%">创建人</th>
				<th width="15%">创建时间</th>
			</tr>
		</thead>
		<tbody>
		<%
		@SuppressWarnings("unchecked")
		List<CheckTaskDefine4Web> checkTaskDefines  = 
			(List<CheckTaskDefine4Web>)request.getAttribute("checkTaskDefines");
		if (checkTaskDefines  != null) {
			for (CheckTaskDefine4Web task: checkTaskDefines) {
		%>
			<%
				String items = "";
				for (String itemStr: task.getCheckItemList()) {
					items += itemStr+" ";
				}
			%>
			<tr>
				<td><%=task.getDescription() %></td>
				<td><%=items %></td>
				<td><%=task.getLevel() %></td>
				<td><%=task.getCreateStaffName() %></td>
				<td><%=task.getCreateDate() %></td>
			</tr>
		<%
			}
		}
		%>
		</tbody>
	</table>
</div>
<!-- End -->